namespace SmartMathLibrary
{
    /// <summary>
    /// Interface to implement a QuadraticFunction class.
    /// </summary>
    public interface IQuadraticFunction
    {
        /// <summary>
        /// Gets or sets the first component of the quadratic function.
        /// </summary>
        /// <value>The first component of the quadratic function.</value>
        double A { get; set; }

        /// <summary>
        /// Gets or sets the second component of the quadratic function.
        /// </summary>
        /// <value>The second component of the quadratic function.</value>
        double B { get; set; }

        /// <summary>
        /// Gets or sets the third component of the quadratic function.
        /// </summary>
        /// <value>The third component of the quadratic function.</value>
        double C { get; set; }

        /// <summary>
        /// Compares the current instance to another quadratic function.
        /// </summary>
        /// <param name="compare">The quadratic function to compare.</param>
        /// <returns>True if the functions are even otherwise, false.</returns>
        bool CompareTo(QuadraticFunction compare);

        /// <summary>
        /// Transforms the current instance of a quadratic function to a polynomial.
        /// </summary>
        /// <returns>The transformed polynomial.</returns>
        SimplePolynomial ToPolynomial();

        /// <summary>
        /// Calculates the function f(x) at a specified x value.
        /// </summary>
        /// <param name="x">The specified x value.</param>
        /// <returns>The f(x) value at a specified x value.</returns>
        double CalculateFunction(double x);

        /// <summary>
        /// Normalizes this quadratic function.
        /// </summary>
        void Normalize();

        /// <summary>
        /// Gets the apex of the quadratic function.
        /// </summary>
        /// <returns>The apex of the quadratic function.</returns>
        Point2D GetApex();

        /// <summary>
        /// Gets the roots of the quadratic function. If the function has no roots the
        /// method will return null.
        /// </summary>
        /// <returns>The roots of the quadratic function.</returns>
        double[] GetRoots();
    }
}